package com.whl.cloud.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import com.whl.cloud.fergn.UserCenter;
import com.whl.cloud.model.UserInfoResult;

@Service
public class OrderService {
	@Autowired
	UserCenter userCenter;

	@Autowired
	RestTemplate restTemplate;

	public String create() {
		// UserInfoResult result = userCenter.getUserById("1");
		UserInfoResult result = restTemplate.getForEntity("http://USER-SERVICE:9001/user-info/1", UserInfoResult.class).getBody();
		return "id = " + result.getId() + "and name = " + result.getName();

	}

}
